<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title>后台管理中心</title>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
</head>
<body style="background-color:#f2f9fd;">
<div class="header bg-main">
    <div class="logo margin-big-left fadein-top">
        <h1>后台管理中心</h1>
    </div>
    <div class="head-l">
        <a class="button button-little bg-red" href="/logout">
            <span class="icon-power-off"></span>退出登录</a></div>
</div>
<div class="leftnav">
    <div class="leftnav-title">
        <div sec:authorize="isAuthenticated()">
            <span sec:authentication="name"></span>
            <img src="images/y.jpg" class="radius-circle rotate-hover" height="50" alt=""/>
        </div>
    </div>
    <div sec:authorize="hasAuthority('user:findAll')">
        <h2><span class="icon-user"></span>系统管理</h2>
        <ul style="display:block">
            <li><a href="/user/findAll" target="right"><span class="icon-caret-right"></span>用户管理</a></li>
            <li><a href="javascript:void(0)" onclick="toCors()" target="right"><span
                    class="icon-caret-right"></span>跨域测试</a></li>
        </ul>
    </div>
    <div >
        <h2><span class="icon-pencil-square-o"></span>数据管理</h2>
        <ul>
            <li><a href="/product/findAll" target="right"><span class="icon-caret-right"></span>商品管理</a></li>
        </ul>
    </div>

</div>
<script type="text/javascript">

    function toCors() {
        $.ajax({
            //  默认情况下，标准的跨域请求是不会发送cookie的
            xhrFields: {
                withCredentials: true
            },
            url: "http://localhost:8090/user/1",   // 根据ID查询用户
            success: function (data) {
                alert("请求成功." + data)
            }
        });
    }


    $(function () {
        $(".leftnav h2").click(function () {
            $(this).next().slideToggle(200);
            $(this).toggleClass("on");
        })
        $(".leftnav ul li a").click(function () {
            $("#a_leader_txt").text($(this).text());
            $(".leftnav ul li a").removeClass("on");
            $(this).addClass("on");
        })
    });
</script>
<ul class="bread">
    <li><a href="{:U('Index/info')}" target="right" class="icon-home"> 首页</a></li>
</ul>
<div class="admin">
    <iframe scrolling="auto" rameborder="0" src="images/bg.jpg" name="right" width="100%" height="100%"></iframe>
</div>
<div style="text-align:center;">
</div>
</body>
</html>